package thread;

public class Demo3_innerclass {
    public static void main(String[] args) throws InterruptedException{
        Thread t = new Thread() {
            @Override
            public void run() {
                System.out.print("Thread");
                try {
                    Thread.sleep(1000);
                }catch (InterruptedException e){
                    e.printStackTrace();
                    throw new RuntimeException(e);
                }
            }
        };
        t.start();
        while(true){
            System.out.println("Main");
            Thread.sleep(1000);
        }
    }
}
